<%@ page import="gdepot.Goods" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main">
    <g:set var="entityName" value="${message(code: 'goods.label', default: 'Goods')}"/>
    <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>

<body>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><g:link controller="goods" action="index">Goods</g:link></li>
        </ol>
    </div>
</div>

<g:if test="${flash.message}">
    <div class="alert alert-warning">
        <a href="#" class="close" data-dismiss="alert">
        &times;
        </a>
        <strong>${flash.message}</strong>
    </div>
</g:if>

<sec:ifAllGranted roles="ROLE_SYSTEM_MANAGER">
    <div class="row" style="padding-bottom:10px">
        <div class="container">
            <div class="col-sm-9"></div>

            <div class="col-sm-3" align="right" style="padding:0px">
                <ul class="list-inline">
                    <li>
                        <g:form url="[resource: goodsInstance, action: 'delete']" method="DELETE">
                            <g:actionSubmit class="btn btn-default btn-sm" action="delete" value="删除"/>
                        </g:form>
                    </li>
                    <li><g:link action="edit" resource="${goodsInstance}"
                                class="btn btn-default btn-sm">编辑</g:link></li>
                    <li><g:link action="create" class="btn btn-default btn-sm">新建</g:link></li>
                </ul>
            </div>
        </div>
    </div>
</sec:ifAllGranted>

<div class="row">
    <div class="col-lg-8 col-lg-offset-2">
        <div class="modal-body">
            <h2 class="text-center">Book details</h2>

            <p class="item-intro text-muted text-center">Here we will show more details about the book.</p>

            <div style="width: 350px; height: 350px; float: left;">
                <g:if test="${goodsInstance.photoUrl?.startsWith('http')}">
                    <img src="${fieldValue(bean: goodsInstance, field: 'photoUrl')}" class="img-responsive"
                         style="width: 350px;height: 350px ;">
                </g:if>
                <g:else>
                    <img src="${createLinkTo(dir: 'payload', file: '' + goodsInstance.photoUrl)}" class="img-responsive"
                         alt="${goodsInstance.photoUrl}"
                         title="${goodsInstance.photoUrl}" style="width: 350px;height: 350px">
                </g:else>
            </div>

            <div style="width: 350px; height: 350px;float: right;">
                <h4><g:link action="show" id="${goodsInstance.id}">
                    ${fieldValue(bean: goodsInstance, field: "title")}
                </g:link></h4>
                <p>Category:${goodsInstance.category?.categoryName}<br/></p>
                %{--<img class="img-responsive img-centered" src="img/portfolio/startup-framework-preview.png" alt="">--}%

                <p>Author: ${fieldValue(bean: goodsInstance, field: "author")}</p>
                <p>Publish: ${fieldValue(bean: goodsInstance, field: "publish")}</p>
                <p>CreateDate: <g:formatDate date="${goodsInstance?.createdDate}"/></p>
                <p>ModifiedDate:<g:formatDate date="${goodsInstance?.modifiedDate}"/> </p>
                <p>Description:${fieldValue(bean: goodsInstance, field: "description")}<br/></p>
                <p>Pricce: ${fieldValue(bean: goodsInstance, field: "price")} 元</p>
                <p>User： ${goodsInstance.user?.username}</p>

            </div>
            <g:form controller="comment" action="create">
                <g:hiddenField name="goodsId" value="${goodsInstance.id}"/>
                <g:submitButton name="submit" value="我要评论" class="btn btn-primary"  style="float: right"/>
            </g:form>
        </div>
     %{--   <p><a href="http://designmodo.com/startup/?u=787">Startup Framework</a> is a website builder for professionals. Startup Framework contains components and complex blocks (PSD+HTML Bootstrap themes and templates) which can easily be integrated into almost any design. All of these components are made in the same style, and can easily be integrated into projects, allowing you to create hundreds of solutions for your future projects.
        </p>--}%

        %{--<p>You can preview Startup Framework <a--}%
                %{--href="http://designmodo.com/startup/?u=787">here</a>.</p>--}%
        %{--<button type="button" class="btn btn-primary" data-dismiss="modal"><i--}%
                %{--class="fa fa-times"></i>Close Project</button>--}%
    </div>
</div>

</body>
</html>




